home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / docume1a / general < prev    next >
Text File  |  1999-09-10  |  7KB  |  160 lines

  1. Attribute VB_Name = "General"
  2. ' This product was created by Marc Majors
  3. ' ------
  4. 'It will be available for public use
  5.  
  6. 'CommonDialog1 = Open File
  7. 'CommonDialog2 = Save File
  8. 'CommonDialog3 = Print File
  9. 'CommonDialog4 = Help File
  10. 'Project started on Jan. 20, 1999
  11. 'Marc Majors
  12.  
  13. 'Known Bugs
  14. '-------------
  15. '
  16. '1:  Closing a document, and hitting a key
  17. 'causes controls to be enabled. - fixed 03/01/99
  18. '2:  Minimizing the form, and creating a
  19. 'new document. - fixed 02/23/99
  20. '3:  Clicking the X in the spell checker.
  21. '4:  Overflow error in the Find and the
  22. 'Replace forms. fixed 03/02/99 v02.01.01.01
  23. '5:  Automation error in the word count
  24. '6:  Part of Bug #1, closing a file does
  25. 'not close the child form. - fixed 03/01/99
  26. '7:  If a document contains bold text, after
  27. 'spelling is completed, the whole document
  28. 'is bold.
  29. '8:  Printing problems
  30.  
  31. Option Explicit
  32.  
  33. '****************API CALLS*************
  34.  
  35. Public Declare Function GetFontData Lib "gdi32" Alias "GetFontDataA" (ByVal hdc As Long, ByVal dwTable As Long, ByVal dwOffset As Long, lpvBuffer As Any, ByVal cbData As Long) As Long
  36. Public Declare Function sendmessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wmsg As Long, ByVal wparam As Long, lparam As Any) As Long
  37. Public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wmsg As Long, ByVal wparam As Long, ByVal lparam As Long) As Long
  38. Public Declare Function SHFileOperation Lib "Shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
  39. Public Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
  40. Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
  41. Public Declare Function mciExecute Lib "winmm.dll" (ByVal lpstrCommand As String) As Long
  42. Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal wNewLong As Long) As Long
  43.  
  44. '****************Constant Declarations*****
  45.  
  46. Public Const GWW_HWNDPARENT = (-8)
  47. Public Const EM_LINEFROMCHAR = &HC9
  48. Public Const FO_DELETE = &H3
  49. Public Const FOF_ALLOWUNDO = &H40
  50. Public Const WM_USER = &H400
  51. Public Const EM_CANUNDO = WM_USER + 22
  52. Public Const EM_EMPTYUNDOBUFFER = WM_USER + 29
  53. Public Const EM_UNDO = &HC7
  54. Public Const TB_SETSTYLE = WM_USER + 56
  55. Public Const TB_GETSTYLE = WM_USER + 57
  56. Public Const TBSTYLE_FLAT = &H800
  57.  
  58. '*****************Variables*************
  59.  
  60. Global WorkArea(250)  As String
  61. Global Users As String
  62. Global User As String
  63. Global boolsave As Boolean
  64. Global boolnew As Boolean
  65. Global Tries As Integer
  66. Global bCannotSave As Boolean
  67.  
  68. Public Type SHFILEOPSTRUCT
  69.  
  70.     hwnd As Long
  71.     wFunc As Long
  72.     pFrom As String
  73.     pTo As String
  74.     fFlags As Integer
  75.     fAnyOperationsAborted As Long
  76.     hNameMappings As Long
  77.     lpszProgressTitle As Long '  only used if FOF_SIMPLEPROGRESS
  78. End Type
  79. Public Function Version()
  80. 'File Version #
  81. 'Version 01.00.00.01 = Initial Version
  82. 'Version 01.00.00.02 = Lots of code cleanup
  83. 'Added Replace form and menu option.  Added
  84. 'Error handling for Run Time Error with the
  85. 'combo box.
  86. 'Version 01.00.00.03 = Moved lots of code to
  87. 'module 2. New and open code from the MDIForm
  88. 'Version 01.01.01.01 - Moved Code into different
  89. 'modules.  Fixed Query_Unload on frmOpenDoc and
  90. 'MDIForm.
  91. 'Version 01.01.01.02 - Added procedure to DocProcedures
  92. 'and cleaned up code.  Fixed 4 existing bugs.
  93. 'Deleted Find Next Option.
  94. 'Version 01.01.01.03 - Fixed Bug #2, error trapping.
  95. 'Version 01.01.01.04 - Fixed the Run Time Error for
  96. 'bug # 1.  02/23/99.
  97. 'Version 01.01.01.05 - Fixed where the find and the
  98. 'replace forms were not unloaded when a document is
  99. 'created or closed.  Also added 2 new procedures to
  100. 'DocProcedures module. 02/24/99
  101. 'Version 01.01.01.06 - Added code to enable Preview,
  102. 'Delete and caption & status bar, when a new file is
  103. 'saved.  Fixed a problem in the find and the replace
  104. 'dialogs.  The whole word only and the case sensitive
  105. 'flags were incorrect.  Took out the shortcut key for
  106. 'paste.  Added error trap in the find and the replace
  107. 'dialogs.  Added a menu to frmPreview. 02/25/99
  108. 'Version 01.01.01.07 - Fixed where the Bold, Italic,
  109. 'Strikethru, Underline, Left, Center, Right would remain
  110. 'pressed after closing or opening a file.  Also fixed
  111. 'the enabling and disabling of the Save and SaveAs
  112. 'options.  02/26/99
  113. 'Version 01.01.01.08 - Toolbar Spelling was not enabled
  114. 'when opening file. Also, set boolnew = true when closing
  115. 'a file.  03/01/99
  116. 'Version 01.01.01.09 - Fixed bugs 1 & 6 - 03/01/99. Also,
  117. 'moved PrintDoc to DocProcedures so frmPreview could use
  118. 'the code.  Added a check when turning on word count for
  119. 'new files.  It was leaving the statusbar blank.
  120. 'Version 02.01.01.01 - Added code to SaveAs for new and
  121. 'existing files.  Fixed the overflow error in the Find and
  122. 'the replace forms.  Changed the variable "Position" to a
  123. 'long variable from a single.
  124. 'Version 02.01.01.02 - Fixed a bug where you open a file,
  125. 'modify it, click new, say no, and the frmOpenDoc would
  126. 'not be visible - 03/03/99.
  127. 'Version 02.01.01.03 - Added code to make sure the application
  128. 'cannot be executed twice.  Also, if a word is not found in
  129. 'find and the replace forms, the Find word is highlighted on
  130. 'the dialog.  Added a select all option.  03/07/99.
  131. 'Version 02.01.01.04 - Fixed a bug in the find and the
  132. 'replace forms where find next did not respect the
  133. 'case sensitive and match case flags.  Also, disabled
  134. 'the rich text box in the query unload in the frmOpenDoc
  135. 'form.  Added a message to the status bar when loading
  136. 'a file.  03/28/1999.
  137. 'Version 02.01.01.05 - Added *.* files to open. Fixed
  138. 'a bug where on a new document, paste, Save would be
  139. 'enabled.  Added check in SaveEnabled for new files.
  140. '04/05/99.
  141. '02.01.01.06 - fixed the bug where if text is bold, then
  142. 'the speller is loaded and cancelled, all of text is bold.
  143. 'no I didn't.  Still investigating.
  144. '02.01.01.07 - fixed some problems where the time/date
  145. 'and selectall options were enabled and disabled when
  146. 'they were not supposed to be.  05/06/99.
  147. '02.01.01.08 - Added find all files, and run options. 05/10/99
  148. '02.01.01.09 - Cleaned code up to make it more readable. 05/18/99
  149. '02.01.01.10 - Moved code into more modules in DocProcedures
  150. '05/20/99'
  151. 'fixed a run-time error when the user maximized the document, by
  152. 'dbl clicking the title bar.  06/07/99
  153. 'fixed a problem in the find dialog where it would not find the
  154. '1st occurence.  Cleaned some other things up. 06/15/99.
  155. Version = "03.01.01.01"
  156. End Function
  157. Public Function User1()
  158. User1 = "MAJORS"  'Default Login Name, currently use is for the status bar
  159. End Function
  160.